<%-- 
    Document   : basicads
    Created on : Apr 13, 2010, 9:10:20 AM
    Author     : williamprado
--%>

<%
HttpSession sesion = request.getSession();
//response.sendRedirect("verpautaFrontController");
int tampagina = 0, npagina = 0;
//tampagina=(Integer)sesion.getAttribute("filas");//esto falta
//npagina= Integer.parseInt(request.getParameter("pag"));//esto tambien
java.util.List<businessObjects.Pauta> pautas;
pautas = (java.util.List<businessObjects.Pauta>)sesion.getAttribute("pautas");
int cant = pautas.size();


try{
  pautas = (java.util.List<businessObjects.Pauta>)sesion.getAttribute("pautas");
   if(sesion.getAttribute("filasBasic")!=null){tampagina=(Integer)sesion.getAttribute("filasBasic");}else{tampagina=5;}
   //if(sesion.getAttribute("pag")!=null){npagina=(Integer)sesion.getAttribute("pag");}else{npagina=0;}
   cant=pautas.size();
}catch(Exception w){tampagina=5; }

try{
 if(request.getParameter("pag") != null){
     npagina= Integer.parseInt(request.getParameter("pag"));
     if(npagina<0)npagina=0;
 }
}catch(Exception e){
    npagina=0;
}

%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Adz - Publicidad Basica</title>
        <link href="css/adz.css" rel="stylesheet" type="text/css" />

        <script src="js/Encriptacion.js" type="text/javascript"></script>
    </head>
    <body bgcolor="#333333">
        <table border="0" width="1024" align="center" bgcolor="#FFFFFF">
        <tr>
            <td width="33%" align="left"><img src="images/adzlogo.jpg" alt="adz logo" width="75%" height="20%"></td>
            <td width="67%" align="center"><h2><strong>Sistema de Publicidad en Linea</strong></h2></td>
          </tr>
        
	<tr bgcolor="#FFFFFF"><td colspan="2">
	<div id="general" align="center">

	<div id="links" align="center">
    	<table width="100%" bgcolor="#999999">
            <tr align="center">
            	<td><form name="basic" method="post" action="verpautaFrontController">
                        <input name="action" type="hidden" value="tobasic">
                        <a style="cursor:pointer" onclick="document.basic.submit();">Ver Publicidad Basica</a></form></td>
                <td><form name="premium" method="post" action="FrontController">
                        <input name="action" type="hidden" value="topremium">
                        <a style="cursor:pointer" onclick="document.premium.submit();">Ver Publicidad Premium</a></form></td>
                <td><form name="reg" method="post" action="registroFrontController">
                        <input name="action" type="hidden" value="toreg">
                        <a style="cursor:pointer" onclick="document.reg.submit();">Registrarse</a></form></td>
                <td><a style="cursor:pointer" href="index.jsp">Volver al indice</a></td>
                <td><form name="pruebaWS" method="post" action="pruebaFC">
                        <input name="action" type="hidden" value="probarWS">
                        <a style="cursor:pointer" onclick="document.pruebaWS.submit();">Probar WS</a></form></td>               <td>01.05.2010 2:03 PM</td>
            </tr>
            
        </table>
	</div>

        <div id="content" align="center">
        
        <h1>Publicidad Basica</h1>
        <p>A continuacion se muestran los banners del esquema publicitario basico:</p>

        <%for(int i=npagina*2*tampagina;i<(2*tampagina*(npagina+1));i++){%>
         <%if(i<cant){%>
         <img src="<%=pautas.get(i).getBanner()%>" alt="banner" width="340" height="100">
        <%}}%>

         <div align="center" >
                <%if(npagina!=0){%>
                    <input name="Anterior pag" type="submit" value="Anteriorpag(<%=(npagina-1)%>)" title="Anteriorpag" onclick="document.location='verpauta.jsp?pag=<%=(npagina-1)%>'" />
                <%}%>
                <%if(2*tampagina*(npagina+1)<cant){%>
                    <input name="Siguiente pag" type="submit" value="Siguientepag(<%=(npagina+1)%>)" title="Siguientepag" onclick="document.location='verpauta.jsp?pag=<%=(npagina+1)%>'" />
                <%}%>

        <table border="1">
            <thead>
                <tr>
                    <th></th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                </tr>
            </tbody>
        </table>

         </div>
        </div>
</div>

    </td></tr>
    </table>

	<div id="footer" align="center">
	Adz - 2010 Copyright &copy; Todos los derechos reservados.</div>       
        
	</body>
</html>
